<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // Promise对象的finally方法
        // 无论Promise对象成功还是失败，最后都会执行这个finally方法
        let p1 = new Promise((resolve,reject)=>{
            resolve(123);
        })
        .then(
            (res)=>{
                console.log("p1成功",res);
            }
        )
        .then(
            (res)=>{
                console.log('p2成功',res);
            }
        )
        .finally(
            ()=>{
                console.log('最后的方法');
            }
        )
    </script>
</body>
</html>